home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
actlib11.zip
/
DATE.ZIP
/
GETDTIME.C
< prev
Wrap
Text File
|
1993-01-14
|
934b
|
45 lines
/* Copyright (C) 1993 Marc Stern (internet: stern@mble.philips.be) */
#include "date.h"
#include <stdlib.h>
#include <memory.h>
#include <time.h>
/***
*
* Function getdtime : Get current time and date
*
* Parameters : Pointer to time & date structure
*
***/
void getdtime( struct tm *dtime )
{ time_t timer;
struct tm *tmp;
time( &timer ); /* get time of day */
tmp = localtime( &timer ); /* converts date/time to a structure */
memcpy( dtime , tmp , sizeof(struct tm) );
#ifdef XXXXX
_AH = 0x2A ; asm int 0x21 ;
dtime.tm_wday = _AL ;
dtime.tm_year = _CX ;
dtime.tm_mon = _DH ;
dtime.tm_day = _DL ;
_AH = 0x2C ; asm int 0x21 ;
dtime.tm_hour = _CH ;
dtime.tm_min = _CL ;
dtime.tm_sec = _DH ;
dtime.tm_hour = _CH ;
/* call mktime to fill in remaining fields of the structure */
mktime( &dtime ) ;
#endif
}